package service;


import java.sql.SQLException;

import java.util.ArrayList;
import java.util.List;

import com.mysql.cj.conf.ConnectionUrlParser.Pair;

import Dao.CommentDAOimpl;
import Dao.RemarkDaoimpl;
import Dao.ZremarkDaoimpl;
import entity.CommentVO;
import entity.Zremark;

public class CommentServiceimpl implements CommentService{
	CommentDAOimpl c=new CommentDAOimpl();
	ZremarkDaoimpl z=new ZremarkDaoimpl();
	RemarkDaoimpl  r=new RemarkDaoimpl();
	public void insert(String email,String wordname,String type,String contant) throws SQLException {
		c.insert(email, wordname, type, contant);
	}
	public void delete(String email)  throws Exception{
		c.delete(email);
	}
	public void update(String email,CommentVO xl)  throws Exception{
		c.update(email, xl);
	}
	public List<CommentVO> select() throws Exception{
		return(c.select());
	}
	public void addlike(int CommentID)  throws Exception{
		c.addlike(CommentID);
	}
	public void addhate(int CommentID)  throws Exception{
		c.addhate(CommentID);
	}
	public Boolean ishe(String email, Integer zremarkid) throws Exception {
		return(z.ishe(email, zremarkid));
	}
	public Boolean delzremark(String email, Integer zremarkid)  throws Exception{
		return(z.delzremark(email, zremarkid));
	}
	public Boolean addzremark(String email,String wordname , Integer remarkid, String contant)  throws Exception{
		return(z.addzremark(email, wordname, remarkid, contant));
	}
	public List<Zremark> getzremark(String wordname, Integer remarkid)  throws Exception{
		return(z.getzremark(wordname, remarkid));
	}
	public List<Pair<CommentVO,List<Zremark>>>  getall()  throws Exception{
		return(r.getall());
	}
	public List<Pair<CommentVO,List<Zremark>>>  getremark(String wordname)  throws Exception{
		return(r.getremark(wordname));
	}
	
}
